﻿Public Class Viewer
  Private _errorDate As New List(Of String)
  Private _errorText As New List(Of String)
  Private _curIndex As Integer = 0

  Public Sub New()
    InitializeComponent()
  End Sub

  Public Sub AddItem(ByVal newDate As String, ByVal newText As String)
    Me._errorDate.Add(newDate)
    Me._errorText.Add(newText)
  End Sub

  Public Sub LoadItem(ByVal index As Integer)
    If index >= 0 AndAlso index < Me._errorDate.Count Then
      Me._curIndex = index
      Me.TextBoxDate.Text = Me._errorDate(Me._curIndex)
      Me.TextBoxText.Text = Me._errorText(Me._curIndex)
    End If
  End Sub

  Private Sub Viewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me._curIndex = 0
    Me.LoadItem(Me._curIndex)
  End Sub

  Private Sub ButtonNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonNext.Click
    Me.LoadItem(Me._curIndex + 1)
  End Sub

  Private Sub ButtonPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonPrevious.Click
    Me.LoadItem(Me._curIndex - 1)
  End Sub

  Private Sub ButtonClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonClose.Click
    Me.Close()
  End Sub
End Class